package com.ruoyi.web.controller.announcement.mapper;

import com.ruoyi.common.core.dao.BaseMapper;
import com.ruoyi.common.entity.DO.FileDO;
import com.ruoyi.common.entity.DO.ShopOrderAnnounceDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IShopOrderAnnounceMapper extends BaseMapper<ShopOrderAnnounceDO> {

    @Select("SELECT id,ann_title annTitle,create_time createTime FROM shop_order_announce where shop_id=#{shopId} and id>#{lastId} order by id desc limit 1")
    ShopOrderAnnounceDO getLastestOne(@Param("shopId") Long shopId, @Param("lastId") Long lastId);

    @Select("SELECT id,ann_title annTitle,create_time createTime FROM shop_order_announce where shop_id=#{shopId} and id>#{lastId} order by id")
    List<ShopOrderAnnounceDO> getLastestList(@Param("shopId") Long shopId, @Param("lastId") Long lastId);

    @Select("SELECT id FROM shop_order_announce where shop_id=#{shopId} order by id desc  limit 5")
    List<Long> getLastestIdList5(@Param("shopId") Long shopId);
}
